package com.company.CollectionDemo;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.assertj.core.data.MapEntry;

import com.google.common.collect.Maps;

import cn.hutool.json.JSONObject;

public class MapDemo {
    public static void main(String[] args) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.putOnce("1", null);
        jsonObject.putOnce("2", null);
        System.out.println(jsonObject);

        Object obj = null;

        Integer num = 11;

        boolean result = num.equals(obj);

        Map<Map.Entry<Integer, Integer>, String> map = new HashMap<>();
        MapEntry<Integer, Integer> entry = MapEntry.entry(null, 1);
        MapEntry<Integer, Integer> entry1 = MapEntry.entry(1, null);
        map.put(Maps.immutableEntry(1, 1), "1");
        map.put(Maps.immutableEntry(1, 1), "1");
        map.put(Maps.immutableEntry(1, 1), "2");

        map.put(entry, "3");
        map.put(entry1, "4");

        System.out.println(map);

        System.out.println(map.get(Maps.immutableEntry(1, 1)));

        List<String> list1 = new ArrayList<String>();
        list1.add("A");
        list1.add("B");

        List<String> list2 = new ArrayList<String>();
        list2.add("B");
        list2.add("C");

        list1.removeAll(list2);
        System.out.println(list1);
    }
}
